module.exports = {
  nav_name: '管理员设置', //生成导航菜单
  module_name: 'admin_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/user/pageSearch", //分页
    changeState: commonPath + '/admin/user/modifyState', //编辑
    detail: commonPath + '/admin/user/get', //详情,
    add: commonPath + '/admin/user/add', //添加
  }`,
  
  table: {
    // isGenerate: "false", //false表示不生成页面
    nav_name: "管理员列表",
    tipsText: "管理员设置 >> 管理员列表",
    // tableReqMethod: "get",  //分页请求配置成get方式, 默认为post
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    // extraPageRequestParams: `
    //   courseId: this.$route.query.id,  //请求
    // `, //已有page和pageSize
    // //mounted代码补充
    // mountedCode: `
    //   this.formData.userId = this.$route.query.userId;
    // `,
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '账户名', name: 'temp', type: "normal", showObj: "{}" },
      { title: '姓名', name: 'temp', type: "normal", showObj: "{}" },
      { title: '身份', name: 'temp', type: "normal", showObj: "{}" },
      { title: '昵称', name: 'temp', type: "normal", showObj: "{}" },
      {
        title: '封面',
        name: 'courseImg',
        type: "img",
        heightVal: "60",
        widthVal: "100",
      },
      {
        title: '状态',
        name: 'state',
        type: "opts",
        showName: "stateShow",
        showObj: `{
          "1": "上架",
          "2": "下架",
        }`
      },
      {
        title: '是否精品',
        name: 'state',
        type: "innerCode",
        innerCode: `{{scope.row.isBoutique == '1' ? "是" : "否"}}`,
      },
    ],
    // tableOptLen: "300px;",
    tableOpt: [
      // {
      //   type: "view",
      //   text: "查看",
      //   request: false,
      //   jump: "/member_manager_see_detail_member查看"
      // },
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/member_manager_edit_member"
      },
      // {
      //   type: "changeState",
      //   text: "加入黑名单",
      //   request: true,
      //   url: "API.member_manager.changeState",
      //   requestType: 'post',
      //   params: `{id,  state: 2 }`, //必须为文本
      //   methodNameTag: 'Black', //方法衔接拓展名
      // },
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.identify_manager.del",
        requestType: 'post',
        isSplitSearchString: 'true', //拼接查询字符串，post启用
      },
      {
        type: "changeState",
        text: "上架",
        request: true,
        url: "API.course_manager.course_list_changeState",
        requestType: 'post',
        params: `{ id,  state: 1 }`, //必须为文本 状态 1上架 2下架
        methodNameTag: 'Open', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '2'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "changeState",
        text: "下架",
        request: true,
        url: "API.course_manager.course_list_changeState",
        requestType: 'post',
        params: `{id,  state: 2 }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
      // {
      //   type: "sort",
      //   text: "调整排序",
      //   url: "API.course_manager.course_chapter_sort",
      //   requestType: 'get',
      // },
    ],
    search: {
      contentArr: {
        input1: { labelName: '账号名', inputName: 'tel' },
        input2: { labelName: '姓名', inputName: 'realName' },
        select1: {
          labelName: '性别',
          inputName: 'sex',  //输入绑定的变量
          selectOptsName: "sexOpts",
          selectOptsArr: `[
            { value: "M", label: "男" },
            { value: "F", label: "女" },
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
        select2: {
          labelName: '来源终端',
          inputName: 'sourceTerminal',
          selectOptsName: "sourceTerminalOpts",
          selectOptsArr: `[
            { value: "android", label: "android" },
            { value: "IOS", label: "IOS" },
            { value: "h5", label: "h5" },
            { value: "", label: "请选择" },
          ],
          `,
        },
        date1: {
          labelName: '注册时间',
          inputName: 'registerTime',
          dateConfig: {
            startDateName: 'registerStartDate',
            endDateName: 'registerEndDate',
            dateChangeMethodsName: 'handleRegisterDateChange'
          }
        },
        date2: {
          labelName: '最后一次登录时间',
          inputName: 'lastLoginTime',
          dateConfig: {
            startDateName: 'lastLoginStartTime',
            endDateName: 'lastLoginEndTime',
            dateChangeMethodsName: 'handleLastLoginDateChange'
          }
        },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
        extraParams: `
          this.formData.userId = this.$route.query.userId;
        `,
      },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "添加",
        request: false,
        jump: "/member_manager_add_page",
        // // 额外的添加参数，写全,query里面的, 用_this
        // extraQueryParams: `
        //   {
        //     goodId : _this.$route.query.goodId,
        //     goodName : _this.$route.query.goodName
        //   }
        // `, 
      }
    },

    //额外请求
    extraRequest: {
      dataCode: [
        "roleOpts"
      ],
      methodsCode: [
        {
          explainText: "管理员角色获取", //说明
          type: "opts&&shows",  //表示选项类型格式，value, label
          methodName: "getRoleData",
          api: "API.admin_manager.role_page",
          optsName: "roleOpts",
          showName: "roleShow",
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,
          optsConfig: {
            label: "roleName",
            value: "id"
          },
          showConfig: {
            key: "id",
            value: "roleName"
          },
        }
      ]
    },
  },

  //添加页面 有个bug add_page_name必须与add_pageX一起用
  add_page1: {
    // isGenerate: "false", //false表示不生成页面
    add_page_name: "add_course_sort",  //尽量短些,要拼接路由
    tipsText: "会员管理 >> 添加",
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    formData: {
      // titleText: "请填写管理员相关信息",
      input1: {
        labelName: '注册手机号',
        inputName: 'tel',
        isNeed: 'true',
        // disabled: 'true', //为true时禁用
      },
      input2: {
        labelName: '姓名',
        inputName: 'realName',
        isNeed: 'true',
      },
      select1: {
        labelName: '性别',
        inputName: 'sex',  //输入绑定的变量
        selectOptsName: "sexOpts",
        selectOptsArr: `[
            { value: "M", label: "男" },
            { value: "F", label: "女" },
            { value: "", label: "请选择"},
          ],
          `, //选项数组
        isNeed: 'true',
      },
      //图片上传
      uploadImg1: {
        labelName: "轮播图上传",
        inputName: "testImgStr",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadBanner",
        isNeed: 'true',
      },
      //三种类型，输入，下拉，图片上传
      textarea1: {
        labelName: '课程简介',
        inputName: 'tel',
        isNeed: 'true',
        rows: "5",
        width: "360", //自动补全px
        isNeed: 'true',
      },
      radio1: {
        labelName: '课程类型',
        inputName: 'courseState',
        radioOpts: [
          { value: "1", label: "图文" },
          { value: "2", label: "视频" },
        ], //这是个同select结构的枚举,但为对象格式
        isNeed: 'true',
        radioWidth: '60px',
        // defaultValue: "", //初始默认值
      },
      //富文本组件 富文本组件添加默认背景
      richText1: {
        labelName: '课程内容(图文)',
        inputName: 'richTextCourse',
        isNeed: 'true',
        minHeight: "180", //高度
        uploadApi: "API.common.upload",
        editContentChangeMethodName: "handleBgEditChange", //改变方法
        isNeed: 'true',
      },
      // //三级联动组件
      // address1: {
      //   label: "地址选择",
      //   inputName: "",
      // }
    },
    addBtn: {
      text: '添加',
      url: "API.member_manager.add",
      extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      jumpPath: "/course_manager_course_chapter",
      extraQueryParams: ` { id: this.$route.query.courseId } `, //跳转时携带参数
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.member_manager.detail", //默认get方式请求
      // detailType: 'get', //请求方式
      isSplitSearchString: 'true', //拼接查询字符串, get和post的必须字段
      // extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      editUrl: "API.member_manager.edit",
      jump: '/member_page_page'
    },
    cancelBtn: { text: "取消" }, //
    //额外请求
    extraRequest: {
      dataCode: [
        "roleOpts"
      ],
      methodsCode: [
        {
          explainText: "管理员角色获取", //说明
          type: "opts",  //表示选项类型格式，value, label
          methodName: "getRoleData",
          api: "API.admin_manager.role_page",
          optsName: "roleOpts",
          params: `{
            "pageIndex": 1,
            "pageSize": 100,
          }`,
          optsConfig: {
            label: "roleName",
            value: "id"
          },
        }
      ]
    },
  },

  //详情页面
  detail_page: {
    // isGenerate: "false", //false表示不生成页面
    detail_page_name: "user_dynamic_detail",
    detail_api: "API.dynamic_manager.detail",
    request_params: `{
        id,
      }`,
    tipsText: "动态管理 >> 用户动态",
    formData: {
      // titleText: "请填写管理员相关信息",
      item1: {
        labelName: "动态内容",
        inputName: 'remark',
        type: "normal",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },

      item2: {
        labelName: '动态图片',
        inputName: 'photo',
        type: "img",
      },
      item3: {
        labelName: '动态类型',
        inputName: 'type',
        type: "innerCode",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
        innerCode: `{{formData.forwardType ? "转载" : "原创"}}`,
      },
      //选项展示
      item4: {
        labelName: '打款状态',
        inputName: 'moneyState',
        type: "opts",
        optShowName: "moneyStateShow",
        optShowStr: `{}`,
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item4: {
        labelName: '用户昵称',
        inputName: 'company',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item4: {
        labelName: '发布时间',
        inputName: 'gmtModified',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
    },
  },



  //占位列表页面
  table_n_1: {
    // isGenerate: "false", //false表示不生成页面
    table_name: "cur_goods_m_table_3",  //表页面名
    nav_name: "商品库列表",  //导航名
    tipsText: "商品库管理 >> 商品库列表", //顶部文字
    //获取列表页面
    tableData: [
    ],
    tableOpt: [
    ],
    search: {
      contentArr: {
      },

    },
  },



  //占位添加页面 有个bug add_page_name必须与add_pageX一起用
  add_page_n_1: {
    // isGenerate: "false", //false表示不生成页面
    add_page_name: "add_course_sort",  //尽量短些,要拼接路由
    tipsText: "会员管理 >> 添加",
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    formData: {
    },
    addBtn: {
      text: '添加',
      url: "API.member_manager.add",
      extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      jumpPath: "/course_manager_course_chapter",
      extraQueryParams: ` { id: this.$route.query.courseId } `, //跳转时携带参数
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.member_manager.detail", //默认get方式请求
      // detailType: 'get', //请求方式
      isSplitSearchString: 'true', //拼接查询字符串, get和post的必须字段
      // extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      editUrl: "API.member_manager.edit",
      jump: '/member_page_page'
    },
    cancelBtn: { text: "取消" }, //
  },



}
